package Telas;

import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JOptionPane;

public class IFrame {

    public IFrame(String url) {

        File arquivo = new File("src/Telas/mapa.html");                
        try{
            if (!arquivo.exists()) {
                arquivo.createNewFile();
            }

            //CRIA NOVO ARQUIVO IGUAL
            FileWriter fw = new FileWriter(arquivo, false);
            BufferedWriter bw = new BufferedWriter(fw);
            bw.write("<iframe src='http://mic-ufg.tk/simples.php?"+ url +"' width='100%' height='100%' style='position:absolute; top:0; left:0; border:0px;'></iframe>");
            bw.close();
            fw.close();
            //JOptionPane.showMessageDialog(null, "SUCESSO AO CRIAR MAPA");
        } catch (IOException ex) {
            JOptionPane.showMessageDialog(null, "FALHA AO CRIAR MAPA");
            Logger.getLogger(IFrame.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
}

        